const { think } = require('thinkjs');
const Base = require('./base.js');

module.exports = class extends Base {
  async getProvinceAction() {
    const data = await this.model('region').where({region_type: 1}).select();
    return this.success(data);
  }
  async getCityAction() {
    const code = this.get('code')
    const data = await this.model('region').where({region_type: 2, parent_id: code}).select();
    return this.success(data);
  }
  async getAreaAction() {
    const code = this.get('code')
    const data = await this.model('region').where({region_type: 3, parent_id: code}).select();
    return this.success(data);
  }
};
